/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.msk.wlhy.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.msk.sys.domain.DataEntity;
import com.msk.sys.domain.Office;
import com.msk.sys.utils.DictMskUtils;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author 作者: zkp
 * @description 描述:车辆档案维护Entity
 * @date 时间: 2018-06-06
 * @return 返回值: null
 */
public class HtCarFiles extends DataEntity<HtCarFiles> {

	private static final long serialVersionUID = 1L;
	private String status;
	private Office company;
	private Office office;
	@NotBlank(message = "车牌号不能为空")
	@Pattern(regexp = "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$", message = "车牌号不正确")
	private String carNumber;
	private String carAttribute;
	private String carType;
	private String carTypeAlias;
	private String licenseType;
	private String carBrand;
	private String carModel;
	/*@NotBlank(message = "道路运输证号不能为空")*/
	private String transportNumber;
	private String licenseNumber;
	private String trailerLicenseNumber;
	private HtDriverFile masterDriverUser;

	private String masterDriverName;

	private HtDriverFile coPilotUser;

	@NotNull(message = "车辆载重不能为空")
	private Double carLoad;

	private String color;

	private String colorAlias;//车牌颜色

	private String carWeight;

	private String carLength;

	private String carWidth;

	private String carHeight;

	private String allUser;

	private String attstr01;

	private String attstr02;
	private String attstr03;
	private String attstr04;
	private Date attdate01;
	private Date attdate02;
	private String carAttributeAlias;

	private String licenseTypeAlias;
	private String carBrandAlias;
	private String carModelAlias;

	private String statusAlias;
	private String transportDetailId;

	private HtSupplier supplier;           //承运商

	private String vehicleOwnership;
	//1 自有   2 外部

	private String vehicleOwnershipAlias;

	private String carDriveLicenseArchiveNo;

	public HtSupplier getSupplier() {
		return supplier;
	}

	public void setSupplier(HtSupplier supplier) {
		this.supplier = supplier;
	}

	private String errorMsg;

	private String name;
	private Integer age;
	private String sex;
	private String phone;
	private String drivingLicenseType;
	private String driverLicenseNumber;

	/*@NotNull(message = "道路运输证开始时间不能为空")*/
	private String periodStartDate;
	/*@NotNull(message = "道路运输证截止时间不能为空")*/
	private String periodEndDate;
    private int isCloseExpire;// 运输证截止时间临近过期 一个月 1没有 2临期
	private Date checkStateExpireDate;

	private String isDispatch;// 是否外派 1 未外派 0 外派
	private String isDispatchAlias;// 是否外派 1 未外派 0 外派
	private Office office1;
	private Office company1;

	private String isPassCheck; // 是否通过审核 0 待审核 1 已审核、2驳回
	private String drivingLicenseCode; // 行驶证编号
	private String drivingLicensePic; // 行驶证图片
	private String transportPic; // 运输证照片
	private String lng;
	private String lat;

	private String isPassCheckAlias;
	private String state;

	private String stateAlias;

	private Date startDateStart;//检索条件开始时间
	private Date startDateEnd;//检索条件结束时间

	/**
	 *start
	 * add by wlx 2020/11/12
	 */
	private String drivingLicensePicCopy;
	private String driverId;
	/** end  */


	/**
	 *start car_weight_type
	 * add by wlx 2020/12/02
	 */
	private String carWeightType;
	private String carWeightTypeAlias;
	//、road_transport_biz_license_img道路运输经营许可证
	private String roadTransportBizLicenseImg;

	/** end  */

	private Date messageSendingDateTime;//发送时间
	private String carMessageFunctionCode;

	private String useCharacter;
	private String vin;
	private String issuingOrganizations;
	private String registerDate;
	private String issueDate;
	private String vehicleEnergyType;
	private String vehicleEnergyAlias;
	private String vehicleAreaCode;
	private String vehicleAreaName;
	private String driverStatus;

	/**
	 * 部分导出使用
	 */
	private String[] idArray;

    /**
     * 司机姓名
     */
	private String masterDriverUserName;
    /**
     * 司机登录号
     */
	private String masterDriverUserPhone;

    private String outSizeStr;

    //add By wlxiang 2021/05/20  //
	private String roadTransportBizLicenseNo;

	public HtCarFiles() {
		super();
	}

	public HtCarFiles(String id) {
		super(id);
	}

	@Length(min = 0, max = 10, message = "车辆状态1正常2在途3异常长度必须介于 0 和 10 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Office getCompany() {
		return company;
	}

	public void setCompany(Office company) {
		this.company = company;
	}

	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}

	@Length(min = 0, max = 30, message = "车牌长度必须介于 0 和 30 之间")
	public String getCarNumber() {
		return carNumber;
	}

	public void setCarNumber(String carNumber) {
		this.carNumber = carNumber;
	}

	@Length(min = 0, max = 10, message = "车辆属性1内部车辆2外部车辆长度必须介于 0 和 10 之间")
	public String getCarAttribute() {
		return carAttribute;
	}

	public void setCarAttribute(String carAttribute) {
		this.carAttribute = carAttribute;
	}

	@Length(min = 0, max = 10, message = "车辆类型长度必须介于 0 和 10 之间")
	public String getCarType() {
		return carType;
	}

	public void setCarType(String carType) {
		this.carType = carType;
	}

	@Length(min = 0, max = 10, message = "牌照类型长度必须介于 0 和 10 之间")
	public String getLicenseType() {
		return licenseType;
	}

	public void setLicenseType(String licenseType) {
		this.licenseType = licenseType;
	}

	@Length(min = 0, max = 10, message = "车辆厂牌长度必须介于 0 和 10 之间")
	public String getCarBrand() {
		return carBrand;
	}

	public void setCarBrand(String carBrand) {
		this.carBrand = carBrand;
	}

	@Length(min = 0, max = 10, message = "车辆型号长度必须介于 0 和 10 之间")
	public String getCarModel() {
		return carModel;
	}

	public void setCarModel(String carModel) {
		this.carModel = carModel;
	}

	@Length(min = 0, max = 100, message = "道路运输证号长度必须介于 0 和 100 之间")
	public String getTransportNumber() {
		return transportNumber;
	}

	public void setTransportNumber(String transportNumber) {
		this.transportNumber = transportNumber;
	}

	@Length(min = 0, max = 50, message = "许可证编号长度必须介于 0 和 50 之间")
	public String getLicenseNumber() {
		return licenseNumber;
	}

	public void setLicenseNumber(String licenseNumber) {
		this.licenseNumber = licenseNumber;
	}

	@Length(min = 0, max = 50, message = "挂车牌照号码长度必须介于 0 和 50 之间")
	public String getTrailerLicenseNumber() {
		return trailerLicenseNumber;
	}

	public void setTrailerLicenseNumber(String trailerLicenseNumber) {
		this.trailerLicenseNumber = trailerLicenseNumber;
	}

	public HtDriverFile getMasterDriverUser() {
		return masterDriverUser;
	}

	public void setMasterDriverUser(HtDriverFile masterDriverUser) {
		this.masterDriverUser = masterDriverUser;
	}

	public String getMasterDriverName() {
		return masterDriverName;
	}

	public void setMasterDriverName(String masterDriverName) {
		this.masterDriverName = masterDriverName;
	}

	public HtDriverFile getCoPilotUser() {
		return coPilotUser;
	}

	public void setCoPilotUser(HtDriverFile coPilotUser) {
		this.coPilotUser = coPilotUser;
	}

	public Double getCarLoad() {
		return carLoad;
	}

	public void setCarLoad(Double carLoad) {
		this.carLoad = carLoad;
	}

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

	public String getColorAlias() {
		if (StringUtils.isNotBlank(color)) {
			return DictMskUtils.getDictLabel(color, "license_plate_color", "");
		}
		return colorAlias;
	}

	public void setColorAlias(String colorAlias) {
		this.colorAlias = colorAlias;
	}

	public String getCarWeight() {
        return carWeight;
    }

    public void setCarWeight(String carWeight) {
        this.carWeight = carWeight;
    }

    public String getCarLength() {
        return carLength;
    }

    public void setCarLength(String carLength) {
        this.carLength = carLength;
    }

    public String getCarWidth() {
        return carWidth;
    }

    public void setCarWidth(String carWidth) {
        this.carWidth = carWidth;
    }

    public String getCarHeight() {
        return carHeight;
    }

    public void setCarHeight(String carHeight) {
        this.carHeight = carHeight;
    }

    @Length(min = 0, max = 200, message = "所有人长度必须介于 0 和 200 之间")
	public String getAllUser() {
		return allUser;
	}

	public void setAllUser(String allUser) {
		this.allUser = allUser;
	}

	@Length(min = 0, max = 200, message = "attstr01长度必须介于 0 和 200 之间")
	public String getAttstr01() {
		return attstr01;
	}

	public void setAttstr01(String attstr01) {
		this.attstr01 = attstr01;
	}

	@Length(min = 0, max = 200, message = "attstr02长度必须介于 0 和 200 之间")
	public String getAttstr02() {
		return attstr02;
	}

	public void setAttstr02(String attstr02) {
		this.attstr02 = attstr02;
	}

	@Length(min = 0, max = 200, message = "attstr03长度必须介于 0 和 200 之间")
	public String getAttstr03() {
		return attstr03;
	}

	public void setAttstr03(String attstr03) {
		this.attstr03 = attstr03;
	}

	@Length(min = 0, max = 200, message = "attstr04长度必须介于 0 和 200 之间")
	public String getAttstr04() {
		return attstr04;
	}

	public void setAttstr04(String attstr04) {
		this.attstr04 = attstr04;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getAttdate01() {
		return attdate01;
	}

	public void setAttdate01(Date attdate01) {
		this.attdate01 = attdate01;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getAttdate02() {
		return attdate02;
	}

	public void setAttdate02(Date attdate02) {
		this.attdate02 = attdate02;
	}

	public String getCarAttributeAlias() {
		if (StringUtils.isNotBlank(carAttributeAlias)) {
			return DictMskUtils.getDictLabel(carAttribute, "car_prop", "");
		}
		return carAttribute;
	}

	public void setCarAttributeAlias(String carAttributeAlias) {
		this.carAttributeAlias = carAttributeAlias;
	}

	public String getCarTypeAlias() {
		if (StringUtils.isNotBlank(carType)) {
			return DictMskUtils.getDictLabel(carType, "car_type", "");
		}
		return carTypeAlias;
	}

	public void setCarTypeAlias(String carTypeAlias) {
		this.carTypeAlias = carTypeAlias;
	}

	public String getLicenseTypeAlias() {
		if (StringUtils.isNotBlank(licenseType)) {
			return DictMskUtils.getDictLabel(licenseType, "car_license_type", "");
		}
		return licenseTypeAlias;
	}

	public void setLicenseTypeAlias(String licenseTypeAlias) {
		this.licenseTypeAlias = licenseTypeAlias;
	}

	public String getCarBrandAlias() {
		if (StringUtils.isNotBlank(carBrand)) {
			return DictMskUtils.getDictLabel(carBrand, "car_brand", "");
		}
		return carBrand;
	}

	public void setCarBrandAlias(String carBrandAlias) {
		this.carBrandAlias = carBrandAlias;
	}

	public String getCarModelAlias() {
		if (StringUtils.isNotBlank(carModel)) {
			return DictMskUtils.getDictLabel(carModel, "car_model", "");
		}
		return carModel;
	}

	public void setCarModelAlias(String carModelAlias) {
		this.carModelAlias = carModelAlias;
	}

	public String getStatusAlias() {
		if (StringUtils.isNotBlank(status)) {
			return DictMskUtils.getDictLabel(status, "car_status", "");
		}
		return status;
	}

	public void setStatusAlias(String statusAlias) {
		this.statusAlias = statusAlias;
	}

	public String getTransportDetailId() {
		return transportDetailId;
	}

	public void setTransportDetailId(String transportDetailId) {
		this.transportDetailId = transportDetailId;
	}


	public String getLogTitle() {
		return "车辆档案维护";
	}

	public String getPeriodStartDate() {
		return periodStartDate;
	}

	public void setPeriodStartDate(String periodStartDate) {
		this.periodStartDate = periodStartDate;
	}

	public String getPeriodEndDate() {
		return periodEndDate;
	}

	public void setPeriodEndDate(String periodEndDate) {
		this.periodEndDate = periodEndDate;
	}

	public int getIsCloseExpire() {
		if (periodEndDate == null) {
			return 1;
		}
        return isCloseExpire;
    }

    public void setIsCloseExpire(int isCloseExpire) {
        this.isCloseExpire = isCloseExpire;
    }

    public Date getCheckStateExpireDate() {
		return checkStateExpireDate;
	}

	public void setCheckStateExpireDate(Date checkStateExpireDate) {
		this.checkStateExpireDate = checkStateExpireDate;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getDrivingLicenseType() {
		return drivingLicenseType;
	}

	public void setDrivingLicenseType(String drivingLicenseType) {
		this.drivingLicenseType = drivingLicenseType;
	}

	public String getDriverLicenseNumber() {
		return driverLicenseNumber;
	}

	public void setDriverLicenseNumber(String driverLicenseNumber) {
		this.driverLicenseNumber = driverLicenseNumber;
	}

	public String getIsDispatch() {
		return isDispatch;
	}

	public void setIsDispatch(String isDispatch) {
		this.isDispatch = isDispatch;
	}

	public Office getOffice1() {
		return office1;
	}

	public void setOffice1(Office office1) {
		this.office1 = office1;
	}

	public Office getCompany1() {
		return company1;
	}

	public void setCompany1(Office company1) {
		this.company1 = company1;
	}

	public String getIsDispatchAlias() {
		if (StringUtils.isNotBlank(isDispatchAlias)) {
			return DictMskUtils.getDictLabel(isDispatch, "is_dispatch", "");
		}
		return isDispatchAlias;
	}

	public void setIsDispatchAlias(String isDispatchAlias) {
		this.isDispatchAlias = isDispatchAlias;
	}

	public String getIsPassCheck() {
		return isPassCheck;
	}

	public void setIsPassCheck(String isPassCheck) {
		this.isPassCheck = isPassCheck;
	}

	public String getDrivingLicenseCode() {
		return drivingLicenseCode;
	}

	public void setDrivingLicenseCode(String drivingLicenseCode) {
		this.drivingLicenseCode = drivingLicenseCode;
	}

	public String getDrivingLicensePic() {
		return drivingLicensePic;
	}

	public void setDrivingLicensePic(String drivingLicensePic) {
		this.drivingLicensePic = drivingLicensePic;
	}

	public String getTransportPic() {
		return transportPic;
	}

	public void setTransportPic(String transportPic) {
		this.transportPic = transportPic;
	}

	public String getLng() {
		return lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getIsPassCheckAlias() {
		if (StringUtils.isNotBlank(isPassCheck)) {
			return DictMskUtils.getDictLabel(isPassCheck, "is_pass_check", "");
		}
		return isPassCheckAlias;
	}

	public void setIsPassCheckAlias(String isPassCheckAlias) {
		this.isPassCheckAlias = isPassCheckAlias;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStateAlias() {
		if (StringUtils.isNotBlank(state)) {
			stateAlias = DictMskUtils.getDictLabel(state, "car_status1", "");
		}
		return stateAlias;
	}

	public void setStateAlias(String stateAlias) {
		this.stateAlias = stateAlias;
	}

	public Date getStartDateStart() {
		return startDateStart;
	}

	public void setStartDateStart(Date startDateStart) {
		this.startDateStart = startDateStart;
	}

	public Date getStartDateEnd() {
		return startDateEnd;
	}

	public void setStartDateEnd(Date startDateEnd) {
		this.startDateEnd = startDateEnd;
	}

	public String getVehicleOwnership() {
		return vehicleOwnership;
	}

	public void setVehicleOwnership(String vehicleOwnership) {
		this.vehicleOwnership = vehicleOwnership;
	}

	public String getVehicleOwnershipAlias() {
		if (StringUtils.isNotBlank(vehicleOwnership)) {
			return DictMskUtils.getDictLabel(vehicleOwnership, "vehicle_ownership", "");
		}
		return vehicleOwnershipAlias;
	}

	public void setVehicleOwnershipAlias(String vehicleOwnershipAlias) {
		this.vehicleOwnershipAlias = vehicleOwnershipAlias;
	}

	public String getCarDriveLicenseArchiveNo() {
		return carDriveLicenseArchiveNo;
	}

	public void setCarDriveLicenseArchiveNo(String carDriveLicenseArchiveNo) {
		this.carDriveLicenseArchiveNo = carDriveLicenseArchiveNo;
	}

	public String getDrivingLicensePicCopy() {
		return drivingLicensePicCopy;
	}

	public void setDrivingLicensePicCopy(String drivingLicensePicCopy) {
		this.drivingLicensePicCopy = drivingLicensePicCopy;
	}

	public String getDriverId() {
		return driverId;
	}

	public void setDriverId(String driverId) {
		this.driverId = driverId;
	}

	public String getCarWeightType() {
		return carWeightType;
	}

	public void setCarWeightType(String carWeightType) {
		this.carWeightType = carWeightType;
	}

	public String getCarWeightTypeAlias() {
		if (StringUtils.isNotBlank(carWeightType)) {
			return DictMskUtils.getDictLabel(carWeightType, "car_weight_type", "");
		}
		return carWeightTypeAlias;
	}

	public void setCarWeightTypeAlias(String carWeightTypeAlias) {
		this.carWeightTypeAlias = carWeightTypeAlias;
	}

	public String getRoadTransportBizLicenseNo() {
		return roadTransportBizLicenseNo;
	}

	public void setRoadTransportBizLicenseNo(String roadTransportBizLicenseNo) {
		this.roadTransportBizLicenseNo = roadTransportBizLicenseNo;
	}

	public String getRoadTransportBizLicenseImg() {
		return roadTransportBizLicenseImg;
	}

	public void setRoadTransportBizLicenseImg(String roadTransportBizLicenseImg) {
		this.roadTransportBizLicenseImg = roadTransportBizLicenseImg;
	}

	public Date getMessageSendingDateTime() {
		return messageSendingDateTime;
	}

	public void setMessageSendingDateTime(Date messageSendingDateTime) {
		this.messageSendingDateTime = messageSendingDateTime;
	}

	public String getCarMessageFunctionCode() {
		return carMessageFunctionCode;
	}

	public void setCarMessageFunctionCode(String carMessageFunctionCode) {
		this.carMessageFunctionCode = carMessageFunctionCode;
	}

	public String getUseCharacter() {
		return useCharacter;
	}

	public void setUseCharacter(String useCharacter) {
		this.useCharacter = useCharacter;
	}

	public String getVin() {
		return vin;
	}

	public void setVin(String vin) {
		this.vin = vin;
	}

	public String getIssuingOrganizations() {
		return issuingOrganizations;
	}

	public void setIssuingOrganizations(String issuingOrganizations) {
		this.issuingOrganizations = issuingOrganizations;
	}

	public String getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(String registerDate) {
		this.registerDate = registerDate;
	}

	public String getIssueDate() {
		return issueDate;
	}

	public void setIssueDate(String issueDate) {
		this.issueDate = issueDate;
	}

	public String getVehicleEnergyType() {
		return vehicleEnergyType;
	}

	public void setVehicleEnergyType(String vehicleEnergyType) {
		this.vehicleEnergyType = vehicleEnergyType;
	}

	public String getVehicleEnergyAlias() {
		if (StringUtils.isNotBlank(vehicleEnergyType)) {
			return DictMskUtils.getDictLabel(vehicleEnergyType, "vehicle_energy_type", "");
		}
		return vehicleEnergyAlias;
	}

	public void setVehicleEnergyAlias(String vehicleEnergyAlias) {
		this.vehicleEnergyAlias = vehicleEnergyAlias;
	}

	public String getVehicleAreaCode() {
		return vehicleAreaCode;
	}

	public void setVehicleAreaCode(String vehicleAreaCode) {
		this.vehicleAreaCode = vehicleAreaCode;
	}

	public String getVehicleAreaName() {
		return vehicleAreaName;
	}

	public void setVehicleAreaName(String vehicleAreaName) {
		this.vehicleAreaName = vehicleAreaName;
	}

	public String[] getIdArray() {
		return idArray;
	}

	public void setIdArray(String[] idArray) {
		this.idArray = idArray;
	}

    public String getMasterDriverUserName() {
	    if(masterDriverUser != null){
	        return masterDriverUser.getName();
        }
        return "";
    }

    public void setMasterDriverUserName(String masterDriverUserName) {
        this.masterDriverUserName = masterDriverUserName;
    }

    public String getMasterDriverUserPhone() {
        if(masterDriverUser != null){
            return masterDriverUser.getPhone();
        }
        return "";
    }

    public void setMasterDriverUserPhone(String masterDriverUserPhone) {
        this.masterDriverUserPhone = masterDriverUserPhone;
    }

    public String getOutSizeStr() {
	    if(carLength != null && carWidth != null && carHeight !=null){
	    	return carLength + "×" + carWidth + "×" + carHeight;
		}
        return "";
    }

    public void setOutSizeStr(String outSizeStr) {
        this.outSizeStr = outSizeStr;
    }

	public String getDriverStatus() {
		return driverStatus;
	}

	public void setDriverStatus(String driverStatus) {
		this.driverStatus = driverStatus;
	}

}